/*
 * Commande.java
 *
 * Created on 30 octobre 2007, 18:56
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.ifips5.nal.epizza.web.model;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.LinkedList;
import java.util.List;


/**
 *
 * @author Moi
 */
public class Commande implements Serializable
{
    
    private int idCommande;
    private List<Pizza> pizzaList = new LinkedList<Pizza>();
    private List<Menu> menuList = new LinkedList<Menu>();
    private int nbPizza = 0;
    private int nbMenu = 0;
    private boolean livree = false;
    private Timestamp date = null;
    
    private Client client;
    
    
    /** Creates a new instance of Commande */
    public Commande()
    {

    }
    
    
        
    public void updateNbPizza()
    {
        nbPizza = pizzaList.size();
    }
         
            
    public void updateNbMenu()
    {
        nbMenu = menuList.size();
    }
    
    public Commande(int idCommande, int livree, Timestamp date)
    {
        this.date = date;
        this.livree = (livree == 1) ? true : false;
        this.idCommande = idCommande;
    }
    
    public Commande(int idCommande, boolean livree, Timestamp date)
    {
        this.date = date;
        this.livree = livree;
        this.idCommande = idCommande;
    }
    
    
    //////////////////////
    // Getters and Setters

    public boolean isLivree()
    {
        return livree;
    }

    public void setLivree(boolean livree)
    {
        this.livree = livree;
    }

    public Timestamp getDate()
    {
        return date;
    }

    public int getNbMenu()
    {
        return nbMenu;
    }       
    public int getNbPizza()
    {
        return nbPizza;
    }       
    public void setNbMenu(int nbMenu)
    {
        this.nbMenu = nbMenu;
    }       
    public void setNbPizza(int nbPizza)
    {
        this.nbPizza = nbPizza;
    }       

    
    public void setDate(Timestamp date)
    {
        this.date = date;
    }

    public List<Menu> getMenuList()
    {
        return menuList;
    }

    public void setMenuList(List<Menu> menuList)
    {
        this.menuList = menuList;
        nbMenu = menuList.size();
    }

    public List<Pizza> getPizzaList()
    {
        return pizzaList;
    }

    public void setPizzaList(List<Pizza> pizzaList)
    {
        this.pizzaList = pizzaList;
        nbPizza = pizzaList.size();
    }

    public int getIdCommande()
    {
        return idCommande;
    }

    public void setIdCommande(int idCommande)
    {
        this.idCommande = idCommande;
    }

    public Client getClient()
    {
        return client;
    }

    public void setClient(Client client)
    {
        this.client = client;
    }
    
}
